package com.evo.chat.admin.domain;

import com.evo.chat.common.base.BaseEntity;
import com.evo.chat.web.domain.Words;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;

/**
 * 回复留言表
 * @author luwenzheng
 * date 2020-02-07
 */
@Entity
@Table(name = "reply")
public class Reply extends BaseEntity {

    /**
     * 回复人的名字
     */
    @NotEmpty(message = "回复人必传")
    private String rName;

    /**
     * 回复内容
     */
    @NotEmpty(message = "请输入回复内容")
    private String rContent;

    /**
     * 回复的是哪个留言
     */
    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "words_id")
    private Words words;

    public String getrName() {
        return rName;
    }

    public void setrName(String rName) {
        this.rName = rName;
    }

    public String getrContent() {
        return rContent;
    }

    public void setrContent(String rContent) {
        this.rContent = rContent;
    }

    public Words getWords() {
        return words;
    }

    public void setWords(Words words) {
        this.words = words;
    }

    @Override
    public String toString() {
        return "Reply{" +
                "rName='" + rName + '\'' +
                ", rContent='" + rContent + '\'' +
                ", words=" + words +
                '}';
    }
}
